/*
 *
 *  This file is part of Cfu
 *
 *  Cfu is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *  
 *  Cfu is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with Cfu. If not, see <http://www.gnu.org/licenses/>.
 *
 *  errors.hpp - william le ferrand (william@corefarm.com) 29/04/2010 15:30
 *
 */


#ifndef CFU_ERRORS_H_
#define CFU_ERRORS_H_

#include <string>

class missing_file
{ 
public: 
  missing_file (std::string &msg) : _msg (msg) {}; 
  
  const char* what() const throw()
  {
    return _msg.c_str ();
  }
  
private: 
  std::string _msg; 
}; 

class corefarm_error
{ 
public: 
  corefarm_error (std::string &msg) : _msg (msg) {}; 
  
  const char* what() const throw()
  {
    return _msg.c_str ();
  }
  
private: 
  std::string _msg; 
}; 

class connector_error
{ 
public: 
  connector_error () {}; 
  
  const char* what() const throw()
  {
    return "Error when connecting to the server"; 
  }
}; 



class json_error
{ 
public: 
  json_error () {}; 
  
  const char* what() const throw()
  {
    return "Error while parsing the answer by the server"; 
  }
}; 

class missing_field
{ 
public: 
  missing_field () {}; 
  
  const char* what() const throw()
  {
    return "Error while parsing the answer by the server"; 
  }
}; 

#endif
